import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {
    BrowserRouter as Router,
    Route,
    Switch
} from 'react-router-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import combinedReduces from './reducers'
import './index.less'
import zhCN from 'antd/es/locale/zh_CN';
import Login from './views/Login'
import { ConfigProvider } from 'antd';
import ErrorBoundary from './components/ErrorBoundary';

let store = createStore(combinedReduces)


ReactDOM.render(
    <ErrorBoundary>
        <ConfigProvider locale={zhCN}>
            <Provider store={store}>
                <Router>
                    <Switch>
                        <Route path='/login' component={Login} />
                        <Route path='/' component={App} />
                    </Switch>
                </Router>
            </Provider>
        </ConfigProvider>
    </ErrorBoundary>,
    document.getElementById('root'));